import request from '@/utils/request'

export function getEnterpriseListAPI(params) {
  return request({
    url: '/park/enterprise',
    params
  })
}

export function getIndustryListAPI() {
  return request({
    url: '/park/industry'
  })
}

export function uploadAPI(data) {
  return request({
    url: '/upload',
    method: 'post',
    data
  })
}

export function createExterpriseAPI(data) {
  return request({
    url: '/park/enterprise',
    method: 'POST',
    data
  })
}

// 获取合同详情，回填企业数据
export function getEnterpriseDetailAPI(id) {
  return request({
    url: `/park/enterprise/${id}`
  })
}

// 编辑，确认修改
export function updateExterpriseAPI(data) {
  return request({
    url: '/park/enterprise',
    method: 'PUT',
    data
  })
}

// 删除企业
export function delEneterpriseAPI(id) {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'DELETE'
  })
}

// 获取可以租赁的楼宇
export function getRentBuildingAPI() {
  return request({
    url: '/park/building'
  })
}

// 添加租赁合同
export function addRentAPI(data) {
  return request({
    url: '/park/enterprise/rent',
    method: 'post',
    data
  })
}

// 获取展开的租赁合同
export function getEnterpriseRentBuildingAPI(id) {
  return request({
    url: `park/enterprise/rent/${id}`
  })
}
